//
// Created by 28365 on 2025/3/13.
//

#ifndef ODUPDATERSDK_DEFAULTUPDATERHANDLER_H
#define ODUPDATERSDK_DEFAULTUPDATERHANDLER_H

#include "IUpdateHandler.h"
#include "../include/ODUpdater.h"

class DefaultUpdaterHandler : public IUpdateHandler{
private:
    const ODUpdater *odUpdater = nullptr;

    int unpublishedVersion = 0;

    int nowVersion = 0;

public:

    void updateStart(UpdateStartEvent &event, const ODUpdater *_odUpdater) override;

    void updateStartVersion(int version) override;

    void preUpdate(PreUpdateEvent &event) override;

    void update(const UpdatingEvent &event) override;

    void postUpdate(const PostUpdateEvent &event) override;

    void updateError(const UpdateErrorEvent &event) override;

    void updateDoneVersion(int version) override;

    void allUpdateComplete(const UpdateCompleteEvent &event) override;

    ~DefaultUpdaterHandler() override;
};


#endif //ODUPDATERSDK_DEFAULTUPDATERHANDLER_H
